package com.yiwei.hdb.impl;

import android.content.Context;

import com.yiwei.hdb.constant.Const;
import com.yiwei.hdb.http.CallBackListener;
import com.yiwei.hdb.http.InterfaceServer;
import com.yiwei.hdb.http.InfoCallBack;
import com.yiwei.hdb.interfaces.UserInfo;
import com.yiwei.hdb.model.RequestModel;
import com.yiwei.hdb.model.UserModel;

import java.util.HashMap;

/**
 * 用户信息
 */
public class UserInfoImpl
        implements UserInfo {
    public void getUserInfo(Context paramContext, final InfoCallBack callBack) {
        RequestModel model = new RequestModel(new HashMap());
        InterfaceServer.getInstance(paramContext.getApplicationContext()).requestInterface(Const.USER, Const.RequestMethod.POST, model, Const.DEFAULT_TIMEOUT,new CallBackListener<UserModel>(UserModel.class,callBack));
//                new ResponseListener() {
//            public void onFinishInMainThread(Object paramAnonymousObject) {
//            }
//
//            public void onStartInMainThread(Object object) {
//                callBack.onFailure(object.toString());
//            }
//
//            @Override
//            public void onSuccessInMainThread(int paramAnonymousInt, String paramAnonymousString, Object result) {
//                try {
//                    UserModel model = (UserModel) result;
//                    callBack.onSuccess(model);
//                } catch (Exception e) {
//                    e.printStackTrace();
//                }
//            }
//
//            @Override
//            public Object onSuccessInRequestThread(int statusCode, String content) {
//                try {
//                    return JsonUtil.<UserModel>fromJson(content, UserModel.class);
//                } catch (Exception e) {
//                    return null;
//                }
//            }
//        });
    }
}
